package lab02.test11;

/**
 * Created by AIR on 2017/10/25.
 */
//矩形类要求实现Printx接口
//printMyWay()方法要能显示矩形的边长、面积和周长。
public class Rectangle implements Printx {
    @Override
    public void printMyWay() {
        System.out.println("该矩形的长length="+length+"宽width="+width);
        System.out.println("面积Area="+getArea());
        System.out.println("周长length="+getLength());

    }
//有求面积、求周长的方法
    double length;
    double width;
    double getArea(){
        return length*width;
    }
    double getLength(){
        return (length+width)*2;
    }

}